import { ApiProperty } from '@nestjs/swagger';
import { IsEnum, IsInt, IsString } from 'class-validator';
import { CopyTypeEnum } from 'src/common/constant/enums';
import { LoginUserResponseDto } from 'src/modules/auth/dto/login-user.dto';

export class CopyDataDto {
  @ApiProperty({ description: '原赛事ID', example: 123, required: true })
  @IsInt()
  tournamentId: number;

  @ApiProperty({
    description: '新赛事名称',
    example: '2023夏季联赛',
    required: true,
    maxLength: 100,
  })
  @IsString()
  tournamentName: string;

  @ApiProperty({
    description:
      'Copy type with following options:\n' +
      '- 10: 赛事创建\n' +
      '- 20: 报名\n' +
      '- 30: 落位\n' +
      '- 40: 编排\n' +
      '- 50: 全部',
    example: CopyTypeEnum.Schedule,
    required: true,
    enum: CopyTypeEnum,
    enumName: 'CopyTypeEnum',
  })
  @IsEnum(CopyTypeEnum)
  type: CopyTypeEnum.Schedule;

  user: LoginUserResponseDto;
}
